﻿using PNAB.BL.Validators;
using PNAB.DAL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PNAB.BL.Providers
{
    class AccountProvider : IAccountProvider
    {
        private IUnitOfWork _unitOfWork;
        private IAccountValidator _accountValidator;

        public AccountProvider(IUnitOfWork unitOfWork, IAccountValidator accountValidator)
        {
            _unitOfWork = unitOfWork;
            _accountValidator = accountValidator;

        }
        public void CreateAccount(string Login, string Password)
        {
            var result =_accountValidator.CreateAccount(Login, Password);
            if(!result.isValid)
            {
                throw new ValidationException(result.ListException);
            }
        }

        public void DeleteAccount(Guid Id)
        {
            throw new NotImplementedException();
        }

        public void UpdateAccount(Guid Id, string Login, string Password)
        {
            throw new NotImplementedException();
        }
    }
}
